﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="App.Web.Views.App.Account.AccountAdmin.Users" %>
<%@ Import Namespace="App.Utility.Paging" %>
<%@ Import Namespace="App.Account.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <% PageResponse<User> Users = (PageResponse<User>)ViewData.Model;
       PagingSet Paging = (PagingSet)ViewData["PagingSet"];
        %>
        <h2>
        Edit Users</h2>
    <h3>
        <%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c=>c.Index(),"<< Return to Account Admin") %></h3>
    <fieldset>
        <legend>Users</legend>
        Filter Results :  <%= Html.FilterInput(Paging, "Go") %><br class="clear" />
        <% if (Users.Page.Count > 0)
           { %><table><thead><tr><th></th><th></th><th><%= Html.PageSorting(Paging, "Name","Name")%></th><th><%= Html.PageSorting(Paging, "Email","E-Mail")%></th></tr></thead><tbody>
           <% foreach (User user in Users.Page)
              { %>
           <tr> <td><%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c => c.EditUser(user.ID), "edit")%></td>
                <td><%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c => c.DeleteUserWithPage(Users.PageIndex + 1, user.ID), "delete", new { onclick="return confirm('Are you sure you wish to delete this item?');"})%></td><td><%= user.Name %></td><td><%= user.Email %></td></tr>
           <%} %></tbody></table><br />
        <%= Html.PageListing(Users,5,"page") %> <br class="clear" /><%= Html.ActionLink<App.Account.Controllers.AccountAdminController>(c=>c.EditUser(null),"Create A New Item") %>
        <% }
           else
           { %>
        <div>
            No items...</div>
        <%} %>
    </fieldset>
</asp:Content>
